<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'签到规则','search'=>'M'))}
	<div class="operate-panel">
		<a class="btn btn-primary" onclick="out_rule()">外出规则</a>
		<div class="split"></div>
		<a class="btn" onclick="add()">新增规则</a>
	</div>
	<div class="">
		<form id="form_data" name="form_data" method='post'>
			<div class="">
				<div class="ul-table ul-table_responsive">
					<ul>
						<li class="thead">
							<div class="pull-left">
								<span class="col-15">规则名称</span>
								<span class="col-15">考勤地点</span>
								<span class="col-15">周边范围</span>
								<span class="col-15">签到/签退时间</span>
								<span class="col-12">操作</span>
							</div>
						</li>
						<foreach name="list" val="vo">
							<li class="tbody">
								<div class="pull-left">
									<span class="col-15"><a href="{:url('Sign/edit_sign_rule')}&id={$vo.id}">{$vo.name}&nbsp;&nbsp;</a></span>
									<span class="col-15">{$vo.address}&nbsp;&nbsp;</span>
									<span class="col-15">{$vo.radius}&nbsp;&nbsp;</span>
									<span class="col-15">{$vo.start_time}/{$vo.end_time}&nbsp;&nbsp;</span>
									<span class="col-12"><a onclick="del_id({$vo.id})">删除</a></span>
								</div>
							</li>
						</foreach>
						<div class="pagination">
							{$page}
						</div>
					</ul>
				</div>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		$(function() {
			set_return_url(null);
		});
		function out_rule() {
			window.open("{:url('out_rule')}", "_self");
		}

		function del_id(id) {
			ui_confirm('确定要删除吗?', function() {
				send_ajax("{:url('Sign/del_sign_rule')}", "id=" + id, function(data) {
					if (data.status) {
						ui_alert(data.info, function() {
							location.reload(true);
						});
					}
				});
			});
		}

		function add() {
			send_form("form_data", "{:url('add_sign_rule')}");
		}

	</script>
</block>
